import {
    Toast
  } from "vant";
  import cTitle from "components/title";
  import {
    scrollMixin
  } from "../../../utils/mixin";
  export default {
    mixins: [scrollMixin], //加载更多
    data() {
      return {
        tabsList: [
            '直推用户',
            '团队用户'
        ],
        current: 0,//0直推 1团队用户
        countNum: 0,
        list: [],
        text: '',
        // page: 1,//分页 当前页数
        // pageCount: 1,//分页  总页数
        isLoadMore: true,
        page: 1,
        total_page: 0,
        username: '',//您的姓名
        mobile: '',//手机号
        feedbackCon: '',//反馈内容
      };
    },
  
    components: {
      cTitle
    },
    // mounted() {
    //   if (!localStorage.getItem("uid")) {
    //     this.$router.push(this.fun.getUrl("member"));
    //     return
    //   }
    //   this.getList();
    // },
    activated() {
      console.log('active')
      if (!localStorage.getItem("uid")) {
        this.$router.push(this.fun.getUrl("member"));
        return
      }
    //   this.getList();
    },
    computed: {
  
    },
    methods: {
        changeTabs(index){
            this.current = index;
            this.getList();
        },
        submit(){
          if(this.username == ''){
            Toast('姓名不能为空')
            return
          }
          if(this.mobile == ''){
            Toast('手机号不能为空')
            return
          }
          if(this.feedbackCon == ''){
            Toast('反馈内容不能为空')
            return
          }
        },
      getList() {
        $http.get("HuanNiuJiuji.teamList", {
          uid: localStorage.getItem("uid"),
          type: this.current + 1
        }, "加载中").then((res) => {
          if (res.result == 1) {
            console.log(res, 'shuju_list')
            this.list = res.data.list;
            this.countNum = res.data.count;
  
          } else {
            this.isLoadMore = false;
          }
        });
      },
      
    }
  };